home *** CD-ROM | disk | FTP | other *** search
- #include <exec/types.h>
- #include <exec/ports.h>
-
- #include <inline/exec.h>
-
- #include <setjmp.h>
-
- jmp_buf jb;
-
- extern struct MsgPort *CreatePort();
-
- _abort()
- {
- longjmp(jb, 1);
- }
-
- main()
- {
- struct MsgPort *mp;
- struct Message *ms;
-
- if (mp=CreatePort("debug.port",0))
- {
- if (setjmp(jb))
- {
- Forbid();
- /* since ^C is checked during IO, puts() is probably interrupted.. */
- if (ms) ReplyMsg(ms);
- while (ms = GetMsg(mp)) ReplyMsg(ms);
- DeletePort(mp);
- Permit();
- exit(1);
- }
-
- for (;;)
- {
- WaitPort(mp);
- while (ms = GetMsg(mp))
- {
- puts(*(char **)&ms[1]);
- ReplyMsg(ms);
- ms = 0;
- }
- }
- }
- }
-
-